package com.zyy.command.demo01;

/**
 * @Description: 类描述
 * @Author: zyy
 * @Date: 2023/08/04 15:57
 */
public class Client {
    public static void main(String[] args) {
        //创建订单
        Order order = new Order();
        order.setDiningTable(1);
        order.setFoodDic("西红柿炒鸡蛋", 1);
        order.setFoodDic("可乐", 2);

        Order order2 = new Order();
        order2.setDiningTable(2);
        order2.setFoodDic("酸溜土豆丝", 1);
        order2.setFoodDic("王老吉", 1);

        //命令接收者
        SeniorChef seniorChef = new SeniorChef();
        //将订单和接受者封装成命令对象
        OrderCommand orderCommand = new OrderCommand(seniorChef, order);
        OrderCommand orderCommand2 = new OrderCommand(seniorChef, order2);

        //创建调用者
        Waitor waitor = new Waitor();
        waitor.addCommand(orderCommand);
        waitor.addCommand(orderCommand2);

        //将订单给柜台 呼叫厨师
        waitor.orderUp();

    }
}
